package com.itheima.个人代码.IO流2;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class Demo3 {
    public static void main(String[] args) throws IOException {
//        FileWriter fw1 = new FileWriter(new File("IO流2和对象操作流properties\\stu1.txt"));
//        FileWriter fw2 = new FileWriter(new File("IO流2和对象操作流properties\\stu1.txt"),true);
//        FileWriter fw3 = new FileWriter("IO流2和对象操作流properties\\stu1.txt",true);
//        FileWriter fw4 = new FileWriter("IO流2和对象操作流properties\\stu1.txt");

        FileWriter fw = new FileWriter("IO流2和对象操作流properties\\stu1.txt",true);
        fw.write(1);
        fw.write(System.lineSeparator());
        fw.write('q');
        fw.write(System.lineSeparator());
        fw.write(new char[]{'1','2','3','4','5','6','q','a','d','f','g'});
        fw.write(System.lineSeparator());
        fw.write(new char[]{'1','2','3','4','5','6','q','a','d','f','g'},1,9);
        fw.write(System.lineSeparator());
        fw.write("123456789锄禾日当午,汗滴禾下土,谁知盘中餐,粒粒皆辛苦.........");
        fw.write(System.lineSeparator());
        fw.write("123456789锄禾日当午,汗滴禾下土,谁知盘中餐,粒粒皆辛苦.........",9,22);
        fw.write(System.lineSeparator());
        fw.close();
    }
}
